// 引入mongoose
const mongoose = require('mongoose');

// 创建一个文档对象结构
let AccountSchema = new mongoose.Schema({
    title: {
        type: String,
        required: true
    },
    time: Date,
    type: {
        type: Number,
        default: -1
    },
    account: {
        type: Number,
        required: true
    },
    remarks: String
})

// 创建一个模型对象 用来操作集合
let AccountModel = mongoose.model('account', AccountSchema);

module.exports = AccountModel;